﻿using FreeSql.DataAnnotations;
using KrasDD.Models;


namespace KrasDD.Models
{

	[JsonObject(MemberSerialization.OptIn), Table(Name = "[innovator].[RELATIONSHIPTYPE]", DisableSyncStructure = false)]
	public partial class RELATIONSHIPTYPE : Relationships<ITEMTYPE, ITEMTYPE>
    {
		[JsonProperty, Column(DbType = "bit")]
		public bool AUTO_SEARCH { get; set; } = true;

		[JsonProperty, Column(StringLength = 64)]
		public string BEHAVIOR { get; set; }

		[JsonProperty, Column(DbType = "bit")]
		public bool COPY_PERMISSIONS { get; set; }

		[JsonProperty, Column(DbType = "bit")]
		public bool CORE { get; set; }

		[JsonProperty, Column(DbType = "bit")]
		public bool CREATE_RELATED { get; set; }

		[JsonProperty, Column(StringLength = -2)]
		public string CSS { get; set; }

		[JsonProperty]
		public int? DEFAULT_PAGE_SIZE { get; set; }

		[JsonProperty, Column(StringLength = 64)]
		public string DESCRIPTION { get; set; }

		[JsonProperty, Column(StringLength = 64)]
		public string GRID_VIEW { get; set; }

		[JsonProperty, Column(DbType = "char(32)")]
		public string HELP_ITEM { get; set; }

		[JsonProperty, Column(StringLength = 80)]
		public string HELP_URL { get; set; }

		[JsonProperty, Column(DbType = "bit")]
		public bool HIDE_IN_ALL { get; set; }

		[JsonProperty, Column(DbType = "bit")]
		public bool INC_REL_KEY_NAME { get; set; } = true;

		[JsonProperty, Column(DbType = "bit")]
		public bool INC_RELATED_KEY_NAME { get; set; } = true;

		[JsonProperty, Column(DbType = "bit")]
		public bool IS_LIST_TYPE { get; set; }

		[JsonProperty, Column(StringLength = 64)]
		public string LABEL { get; set; }

		[JsonProperty]
		public int? MAX_OCCURS { get; set; }

		[JsonProperty]
		public int? MIN_OCCURS { get; set; }

		[JsonProperty, Column(StringLength = 32, IsNullable = false)]
		public string NAME { get; set; }

		[JsonProperty, Column(DbType = "bit")]
		public bool NEW_SHOW_RELATED { get; set; }


		[JsonProperty, Column(DbType = "bit")]
		public bool RELATED_NOTNULL { get; set; }

		[JsonProperty, Column(StringLength = 64)]
		public string RELATED_OPTION { get; set; } = "2";

		[JsonProperty, Column(DbType = "char(32)")]
		public string RELATIONSHIP_ID { get; set; }

		[JsonProperty]
		public int? SORT_ORDER { get; set; }



		#region 外键 => 导航属性，ManyToOne/OneToOne

		[Navigate("SOURCE_ID")]
		public virtual ITEMTYPE Source { get; set; }

		[Navigate("RELATED_ID")]
		public virtual ITEMTYPE Related { get; set; }
		#endregion
	}

}
